<template>
  <div>
    <child ref="child"></child>
    <button @click="fun">哈哈</button>
  </div>
</template>

<script>
import child from "./child";

export default {
  name: "index",
  components: {
    child
  },
  methods: {
    fun() {
      console.log(this.$refs.child.name)
    }
  }
}
</script>

<style lang="less" scoped>

</style>